Document Metadata Search
Introduction
The following Assetic REST API endpoints may be used to get document metadata:
- GET /api/v2/document/{id}
- GET /api/v2/document
GET /api/v2/document/{id}
The Assetic REST API endpoint GET /api/v2/document/{id} is used to get the document metadata for a single document, where {id} is the Assetic GUID for the document. This API endpoint is typically used when the GUID has been recorded in an external application such as a document management system.
Sample payload
The following sample payload gets the document metadata for a document record where the document GUID is known:
https://xxx.assetic.net/api/v2/document/73fd8b97-d04f-e711-8187-025500ccdddb
GET /api/v2/document
The Assetic REST API endpoint GET /api/v2/document is used to get the document metadata for a paginated set of documents. Typically a search filter is applied to restrict the list of documents returned.
Filtering and sorting
The document search filter is restricted to the following metadata fields in the table below:
Field Name | Description | Type |
Label | The document label | String |
ExternalId | The External ID | String |
LastModified | The Last Modified Date of the document metadata changes | Datetime |
CreatedDate | The date the document record was created | Datetime |
Id | Document record internal Assetic ID | GUID |
ParentId | The internal Assetic ID for the record (Asset, Work Order, Work Request etc) that the document is associated with. Must also specify ParentType | GUID |
ParentType | The name of the record that the document is associated with e.g. Asset, Work Order, Work Request. Refer to the article Uploading-Files for the list of valid ParentTypes. | String |
MimeType | The file extension of the document indicating the file format. | String |
IsImage | Boolean value, when true indicates the document is an image file such as jpg, png. This value is system defined and is not an attribute that is explicitly set by the user when uploading the image file. | Boolean |
The article Search Filters and Pagination describes the correct syntax to use when applying search criteria and sort order.
Pagination
For the Assetic REST API endpoints with paginated results there is a 500 records per page maximum and a 20 record default. Unlike the Advanced Search API there is no limit to the number of pages that may be returned.
The 'pageSize' parameter is used to set page size, and 'page' parameter used to set the page number.
Sample payload
The following sample payload gets a list of document metadata for a set of documents record where the ExternalId has 'ABAB' within it's text, or where the Last Modified Date of the document metadata is greater than or equal to '2017-03-14 03:55:43.323':
https://demo.assetic.net/api/v2/document/?requestParams.filters=ExternalId~contains~'ABAB'~or~LastModified~gte~'2017-03-14 03:55:43.323'
Sample Response
The following response illustrates the metadata returned by GET /api/v2/document/{id}. In this instance the Id is "c6766e12-d59b-e611-946c-06edd62954d5", and it is a jpg photo attached to a Work Request (WR3710).
{ "Id": "c6766e12-d59b-e611-946c-06edd62954d5", "Name": null, "Label": "alpaca", "ExternalId": null, "ExpiryDate": null, "CreatedDate": "2016-10-27T10:36:33", "LastModified": "2016-10-27T10:36:33", "DocumentSize": 0, "DocumentLink": null, "MimeType": "jpg", "DocumentGroup": 3, "DocGroupValue": "StarRating", "DocGroupLabel": "Star Rating", "DocumentSubCategory": 2, "DocSubCategoryValue": "SearchProfile", "DocSubCategoryLabel": "Search Profile", "DocumentCategory": 6, "DocCategoryValue": "Exports", "DocCategoryLabel": "Exports", "CreatedUserFirstName": "Kevin", "CreatedUserLastName": "Wilson", "LastModifiedUserFirstName": "Kevin", "LastModifiedUserLastName": "Wilson", "FileProperty": [], "DocumentSource": "", "ParentType": 3, "ParentId": "fc24171e-9f99-e611-946c-06edd62954d7", "ParentIdentifier": null, "RecordId": "00000000-0000-0000-0000-000000000000", "IsKeyPhoto": false, "IsImage": true "Status": 300, "DocumentAsset": null, "DocumentWorkRequest": { "WorkRequestId": "fc24171e-9f99-e611-946c-06edd62954d7", "FriendlyId": "WR3710", "DocumentAsset": { "AssetName": null, "Id": "00000000-0000-0000-0000-000000000000", "AssetId": null, "_links": [], "_embedded": null }, "_links": [], "_embedded": null }, "DocumentWorkOrder": null, "DocumentAssessmentFormResult": null, "DocumentGroupAsset": null, "_links": [], "_embedded": null }